package com.ttdevs.net.observer;

import java.util.ArrayList;
import java.util.Observable;
import java.util.Observer;

public class NetObservable extends Observable {

	private ArrayList<Observer> netObserver = new ArrayList<Observer>();

	@Override
	public synchronized void addObserver(Observer observer) {
		this.netObserver.add(observer);
	}

	@Override
	public synchronized void deleteObserver(Observer observer) {
		this.netObserver.remove(observer);
	}

	@Override
	public void notifyObservers(Object data) {
		for (Observer observer : netObserver) {
			observer.update(this, data);
		}
	}

}
